package com.unytech.wisdomcommunity.complainrepairfragment;

import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.unytech.wisdomcommunity.R;
import com.unytech.wisdomcommunity.view.ShowPhotoGalleryDialog;

/**
 * Created by zed on 2016/11/14/0014.
 *
 * "报修"的fragment
 */
public class RepairFragment extends Fragment implements View.OnClickListener{
    private View mRootView;

    private ImageView mAddPhoto_a2;
    private ImageView mAddPhoto_b2;
    private ImageView mAddPhoto_c2;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        if (mRootView==null) {
            mRootView = inflater.inflate(R.layout.repair_fragment, container, false);
        }

        initView(mRootView);

        return mRootView;
    }
    private void initView(View mRootView) {
        mAddPhoto_a2 = (ImageView) mRootView.findViewById(R.id.comlain_addphoto_iv_a2);
        mAddPhoto_b2 = (ImageView) mRootView.findViewById(R.id.comlain_addphoto_iv_b2);
        mAddPhoto_c2 = (ImageView) mRootView.findViewById(R.id.comlain_addphoto_iv_c2);

        mAddPhoto_a2.setOnClickListener(this);
        mAddPhoto_b2.setOnClickListener(this);
        mAddPhoto_c2.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.comlain_addphoto_iv_a2:
                //弹出popupWindow
                //showPopupWindow(v);
                //2.弹出Dialog
                initDialog();
                break;
            case R.id.comlain_addphoto_iv_b2:
                break;
            case R.id.comlain_addphoto_iv_c2:
                break;
            default:
                break;
        }
    }
    //2.初始化Dialog
    private void initDialog() {
        ShowPhotoGalleryDialog dialog = new ShowPhotoGalleryDialog(getActivity(),this);
        dialog.show();
    }
}